package com.momoback.feign;


import com.alibaba.fastjson.JSONObject;
import com.momoback.config.FeignClientConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.net.URI;
import java.util.Map;

@FeignClient(name = "file-upload-client", url = "https://kimi.moonshot.cn/api", configuration = {FeignClientConfig.class, FeignClientAuthInterceptor.class})
public interface OpenFeignClient {

    //    @PostMapping(value = "/pre-sign-url", consumes = "application/json")
//    Object preSignUrlFile(@RequestPart("file") MultipartFile file,@RequestPart("name") String name,@RequestPart("action") String action);
//
    @PostMapping(value = "/pre-sign-url")
    Map<String, String> preSignUrlFile(JSONObject message);

    @PostMapping(value = "/user/wx/register_login")
    Object getRegisterId();

    @GetMapping("/user/wx/register_login/{registerId}")
    Object createStatus(@PathVariable("registerId") String registerId);

    @PostMapping(value = "/user/sms/verify-code", consumes = "application/json")
    Object sendVerifyCode(@RequestBody JSONObject jsonObject);

    @PostMapping(value = "user/register/trial", consumes = "application/json")
    JSONObject verifyPhoneCode(@RequestBody JSONObject json);

    @PostMapping(value = "/chat/cs2uf0q34pe8ck2fgjig/completion/stream")
    Object getStreamMessage(JSONObject message);

    @RequestMapping(method = RequestMethod.PUT,consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    JSONObject uploadImage(URI uri,@RequestPart("file") MultipartFile file,@RequestHeader Map<String, String> headers);

    @PostMapping(value = "/file", consumes = "application/json")
    Map<String, String> submitfile(JSONObject fileParamsJson);
    @RequestMapping(method = RequestMethod.GET)
    void uploadPresignImage(URI uri,@RequestPart("file")MultipartFile file);

}
